package web.search.impl;

import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexReaderContext;
import org.apache.lucene.search.*;

import java.io.IOException;
import java.util.concurrent.ExecutorService;

/**
 * Created by Administrator on 2016/5/26.
 */
public class IndexSearcherChildren extends IndexSearcher {
    public IndexSearcherChildren(IndexReader r) {
        super(r);
    }

    public IndexSearcherChildren(IndexReader r, ExecutorService executor) {
        super(r, executor);
    }

    public IndexSearcherChildren(IndexReaderContext context, ExecutorService executor) {
        super(context, executor);
    }

    public IndexSearcherChildren(IndexReaderContext context) {
        super(context);
    }

    public TopFieldDocs search(Query query, int n,
                               Sort sort) throws IOException {
        return search(createNormalizedWeight(query), n, sort, true, true);
    }

}
